using System;
using System.Collections.Generic;
using System.Text;
using Widgetsphere.GeneratorEngine;

namespace Omniture.API.Generators.Objects
{
	internal class EventRuntimeItemTemplate : BaseTemplate
	{
		internal EventRuntimeItemTemplate(OmnitureProject project)
			: base(project)
		{
		}

		public override string FileContent
		{
			get
			{
				var sb = new StringBuilder();
				sb.AppendLine("using System;");
				sb.AppendLine("using System.Collections.Generic;");
				sb.AppendLine("using System.Text;");
				sb.AppendLine();
				sb.AppendLine("namespace Omniture.Plugin");
				sb.AppendLine("{");
				sb.AppendLine("	[Serializable()]");
				sb.AppendLine("	internal class EventRuntimeItem");
				sb.AppendLine("	{");
				sb.AppendLine("		#region Class Members");
				sb.AppendLine();
				sb.AppendLine("		private string _name = string.Empty;");
				sb.AppendLine("		private string _value = string.Empty;");
				sb.AppendLine("		private bool _enabled = false;");
				sb.AppendLine();
				sb.AppendLine("		#endregion");
				sb.AppendLine();
				sb.AppendLine("		#region Constructors");
				sb.AppendLine();
				sb.AppendLine("		internal EventRuntimeItem(string name)");
				sb.AppendLine("		{");
				sb.AppendLine("			_name = name;");
				sb.AppendLine("		}");
				sb.AppendLine();
				sb.AppendLine("		#endregion");
				sb.AppendLine();
				sb.AppendLine("		#region Property Implementations");
				sb.AppendLine();
				sb.AppendLine("		public string Name");
				sb.AppendLine("		{");
				sb.AppendLine("			get { return _name; }");
				sb.AppendLine("		}");
				sb.AppendLine();
				sb.AppendLine("		public string Value");
				sb.AppendLine("		{");
				sb.AppendLine("			get { return _value; }");
				sb.AppendLine("			set {_value = value; }");
				sb.AppendLine("		}");
				sb.AppendLine();
				sb.AppendLine("		public bool Enabled");
				sb.AppendLine("		{");
				sb.AppendLine("			get { return _enabled; }");
				sb.AppendLine("			set {_enabled = value; }");
				sb.AppendLine("		}");
				sb.AppendLine();
				sb.AppendLine("		#endregion");
				sb.AppendLine();
				sb.AppendLine("	}");
				sb.AppendLine("}");
				return sb.ToString();
			}
		}

		public static void Generate(OmnitureProject project, string destinationFolder)
		{
			EventRuntimeItemTemplate t = new EventRuntimeItemTemplate(project);
			t.Generate(destinationFolder);
		}

		public override string FileName
		{
			get { return @"EventRuntimeItem.cs"; }
		}

	}
}
